package tg.webclient.rj.beans.workticket;

import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException;

import psdi.util.MXException;
import psdi.webclient.system.beans.AppBean;
import psdi.webclient.system.controller.WebClientEvent;

public class CustAppBean extends AppBean {
	// public int Comp() throws MXException, RemoteException {
	// MboSetRemote mboset = this.app.getDataBean().getMboSet();
	// mboset.getSelection();
	// return 1;
	// }

	public int Comp(boolean open) throws MXException {
		WebClientEvent event = clientSession.getCurrentEvent();
		int row;
		row = getRowIndexFromEvent(event);
		if (currentRow == row) {
			if (tableStateFlags.isFlagSet(64L))
				// validateRow();
				tableStateFlags.setFlag(64L, open);
			try {
				clientSession.getCurrentEventHandler().handleEvent(
						new WebClientEvent("refresh", getId(), event,
								clientSession));
			} catch (InvocationTargetException ite) {
			} catch (IllegalAccessException iae) {
			} catch (NoSuchMethodException nsmee) {
			}
			return 0;
		}
		try {
			if (tableStateFlags.isFlagSet(64L))
				validateRow();
			setCurrentRow(row);
			tableStateFlags.setFlag(128L, true);
			tableStateFlags.setFlag(64L, open);
		} catch (RemoteException e) {
			handleRemoteException(e);
		}
		return 1;
	}
}
